<!DOCTYPE html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <link rel="shortcut icon" href="/images/favicon/favicon.ico"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>登录</title>
    <!--必要样式-->
    <link rel="stylesheet" type="text/css" href="/css/login/component.css"/>
    <link rel="stylesheet" href="/css/layui.css">
</head>

<body>
<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <h3>欢迎你</h3>
                <form action="#" name="f" method="post">
                    <div class="input_outer">
                        <span class="u_user"></span>
                        <input name="email" id="email" required lay-verify="required" class="text"
                               style="color: #FFFFFF !important" type="text" value="2507511047@qq.com" placeholder="请输入账户">
                    </div>
                    <div class="input_outer">
                        <span class="us_uer"></span>
                        <input name="password" id="password" class="text"
                               style="color: #FFFFFF !important; position:absolute;  z-index:100;" value="123456"
                               type="password" placeholder="请输入密码">
                    </div>
                    <div class="mb2"><a id="sub" lay-submit lay-filter="sub" class="act-but submit" href="javascript:;"
                                        style="color: #FFFFFF">登录</a></div>
                </form>
            </div>
        </div>
    </div>
</div><!-- /container -->
<script src="/js/login/TweenLite.min.js"></script>
<script src="/js/login/EasePack.min.js"></script>
<script src="/js/login/rAF.js"></script>
<script src="/js/login/demo-1.js"></script>
<script src="/layui.js"></script>
<script>
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer;
        var form = layui.form;
        var $ = layui.$;
        form.on('submit(sub)', function () {
            $.ajax({
                url: '/user/login',
                method: 'POST',
                data:{
                   email:$("#email").val(),
                   password:$("#password").val()
                },
                success: function (result) {
                    console.log(result)
                    if (result.code == 200) {
                        window.location.href = result.data;
                    } else {
                        layer.msg(result.msg);
                        return false;
                    }
                }
            })
        });

    });
</script>

</body>

</html>